﻿@model PagedList.IPagedList<Test710.Models.Stadium>
@using PagedList.Mvc; 
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create", null, new { @class="actionlink"})
</p>
@using (Html.BeginForm("Index", "Stadium", FormMethod.Get))
{
    <p>
        Find by name: @Html.TextBox("SearchString", ViewBag.CurrentFilter as string)  
        <input type="submit" value="Search" class="btsearch"/>
    </p>
}
<table class="flat-table flat-table-3">
    <tr>
        <th>
            @Html.ActionLink("StadiumName", "Index", new { sortOrder=ViewBag.NameSortParm, currentFilter=ViewBag.CurrentFilter })
            @*@Html.DisplayNameFor(model => model.StadiumName)*@
        </th>
        <th>
            Webpage
            @*@Html.DisplayNameFor(model => model.Webpage)*@
        </th>
        <th>
            Status
            @*@Html.DisplayNameFor(model => model.Status)*@
        </th>
        <th>
            LuxLevel
            @*@Html.DisplayNameFor(model => model.LuxLevel)*@
        </th>
        <th>
            Comment
            @*@Html.DisplayNameFor(model => model.Comment)*@
        </th>
        <th>
             @Html.ActionLink("Country", "Index", new { sortOrder=ViewBag.DateSortParm, currentFilter=ViewBag.CurrentFilter })
            @*@Html.DisplayNameFor(model => model.Country)*@
        </th>
        <th>
            Address
            @*@Html.DisplayNameFor(model => model.Address)*@
        </th>
        <th>
            City
            @*@Html.DisplayNameFor(model => model.City)*@
        </th>
        <th>
            County
            @*@Html.DisplayNameFor(model => model.County)*@
        </th>
       @* <th>
            @Html.DisplayNameFor(model => model.Postcode)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PublicComment)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.MainNumber)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Cell)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Fax)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Email)
        </th>*@
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.StadiumName, "Details", new { id = item.StadiumId }, new { @class="actionlink" })
            @*@Html.DisplayFor(modelItem => item.StadiumName)*@
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Webpage)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Status)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LuxLevel)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Comment)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Country)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Address)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.City)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.County)
        </td>
        @*<td>
            @Html.DisplayFor(modelItem => item.Postcode)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PublicComment)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.MainNumber)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Cell)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Fax)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>*@
        <td>
            @*@Html.ActionLink("Edit", "Edit", new { id=item.StadiumId })*@
            
            @Html.ActionLink("Delete", "Delete", new { id = item.StadiumId }, new { @class="actionlink"})
        </td>
    </tr>
}

</table>
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount

@Html.PagedListPager( Model, page => Url.Action("Index", new { page, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter }) )